/*
 * @Author: your name
 * @Date: 2021-12-21 12:20:38
 * @LastEditTime: 2021-12-21 14:01:52
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \json-serveg:\桌面2\50htmljs\scroll\script.js
 */
const boxs = document.querySelectorAll('.box')

window.addEventListener('scroll',()=>{
    const triggerBottom =  window.innerHeight / 5*4
    // console.log(triggerBottom)
    boxs.forEach(box=>{
        const boxTop = box.getBoundingClientRect().top
        if (boxTop < triggerBottom) {
            box.classList.add('show')
        }else{
            box.classList.remove('show')
        }
    })
})

